﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

// 多播
public delegate void MyDelegate(string message);
namespace CS_BEGINNER_TO_PROFICIENT.STD.DelegatedSTD
{
    public class DelegatedSTDP2
    {
        static void Method1(string message) => Console.WriteLine("Method1: " + message);

        static void Method2(string message) => Console.WriteLine("Method2: " + message);

        public static void Execute()
        {
            MyDelegate del = Method1;
            del += Method2;
            del("Hello World");
        }
    }
}
